package guitplugin;

import com.guit.client.apt.HasEntityProxy;
import com.guit.client.apt.HasValueProxy;
import com.sun.mirror.apt.AnnotationProcessor;
import com.sun.mirror.apt.AnnotationProcessorEnvironment;
import com.sun.mirror.apt.AnnotationProcessorFactory;
import com.sun.mirror.declaration.AnnotationTypeDeclaration;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;

public class ProxyProcessorFactory implements AnnotationProcessorFactory {

  @Override
  public Collection<String> supportedOptions() {
    return Collections.emptyList();
  }

  @Override
  public Collection<String> supportedAnnotationTypes() {
    return annotations;
  }

  @Override
  public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds,
      AnnotationProcessorEnvironment env) {
    return new ProxyProcessor(env);
  }

  public static ArrayList<String> annotations = new ArrayList<String>();
  {
    annotations.add(HasEntityProxy.class.getCanonicalName());
    annotations.add(HasValueProxy.class.getCanonicalName());
  }
}
